home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / ATA.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  53.5 KB  |  937 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        ATA.a
  3. ;
  4. ;    Contains:    ATA (PC/AT Attachment) Interfaces
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__ATA__') = 'UNDEFINED' THEN
  18. __ATA__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  24.     include 'MixedMode.a'
  25.     ENDIF
  26.  
  27.  
  28. ;  This is the structure used for the AT Interface core routines below 
  29.  
  30. kATATrap                        EQU        $AAF1                ; Manager trap number <This should be defined in Traps.h>
  31. kATAPBVers1                        EQU        $01                    ; parameter block version number 1
  32. kATAPBVers2                        EQU        $02                    ; parameter block version number for structures
  33. kATAPBVers3                        EQU        $03                    ; parameter block version for ATA times
  34. kATADefaultBlockSize            EQU        512                    ; default block size
  35. ;  Used to determine the presence of traps
  36.  
  37. kFSMTrap                        EQU        $AC
  38. mDQEChanged                        EQU        1                    ; DQE has changed 
  39. ;  Task file definition ••• Error Register •••
  40.  
  41. bATABadBlock                    EQU        7                    ; bit number of bad block error bit
  42. bATAUncorrectable                EQU        6                    ; bit number of uncorrectable error bit
  43. bATAMediaChanged                EQU        5                    ; bit number of media changed indicator
  44. bATAIDNotFound                    EQU        4                    ; bit number of ID not found error bit
  45. bATAMediaChangeReq                EQU        3                    ; bit number of media changed request
  46. bATACommandAborted                EQU        2                    ; bit number of command abort bit
  47. bATATrack0NotFound                EQU        1                    ; bit number of track not found
  48. bATAAddressNotFound                EQU        0                    ; bit number of address mark not found
  49. mATABadBlock                    EQU        $80                    ; Bad Block Detected
  50. mATAUncorrectable                EQU        $40                    ; Uncorrectable Data Error
  51. mATAMediaChanged                EQU        $20                    ; Media Changed Indicator (for removable)
  52. mATAIDNotFound                    EQU        $10                    ; ID Not Found
  53. mATAMediaChangeReq                EQU        $08                    ; Media Change Requested (NOT IMPLEMENTED)
  54. mATACommandAborted                EQU        $04                    ; Aborted Command
  55. mATATrack0NotFound                EQU        $02                    ; Track 0 Not Found
  56. mATAAddressNotFound                EQU        $01                    ; Address Mark Not Found
  57. ;  Task file definition ••• Features register •••
  58.  
  59. bATAPIuseDMA                    EQU        0                    ; bit number of useDMA bit (ATAPI)
  60. mATAPIuseDMA                    EQU        $01
  61. ;  Task file definition ••• ataTFSDH Register •••
  62.  
  63. mATAHeadNumber                    EQU        $0F                    ; Head Number (bits 0-3) 
  64. mATASectorSize                    EQU        $A0                    ; bit 7=1; bit 5 = 01 (512 sector size) <DP4>
  65. mATADriveSelect                    EQU        $10                    ; Drive (0 = master, 1 = slave) 
  66. mATALBASelect                    EQU        $40                    ; LBA mode bit (0 = chs, 1 = LBA)
  67. ;  Task file definition ••• Status Register •••
  68.  
  69. bATABusy                        EQU        7                    ; bit number of BSY bit
  70. bATADriveReady                    EQU        6                    ; bit number of drive ready bit
  71. bATAWriteFault                    EQU        5                    ; bit number of write fault bit
  72. bATASeekComplete                EQU        4                    ; bit number of seek complete bit
  73. bATADataRequest                    EQU        3                    ; bit number of data request bit
  74. bATADataCorrected                EQU        2                    ; bit number of data corrected bit
  75. bATAIndex                        EQU        1                    ; bit number of index mark
  76. bATAError                        EQU        0                    ; bit number of error bit
  77. mATABusy                        EQU        $80                    ; Unit is busy
  78. mATADriveReady                    EQU        $40                    ; Unit is ready
  79. mATAWriteFault                    EQU        $20                    ; Unit has a write fault condition
  80. mATASeekComplete                EQU        $10                    ; Unit seek complete
  81. mATADataRequest                    EQU        $08                    ; Unit data request
  82. mATADataCorrected                EQU        $04                    ; Data corrected
  83. mATAIndex                        EQU        $02                    ; Index mark - NOT USED
  84. mATAError                        EQU        $01                    ; Error condition - see error register
  85. ;  Task file definition ••• Device Control Register •••
  86.  
  87. bATADCROne                        EQU        3                    ; bit number of always one bit
  88. bATADCRReset                    EQU        2                    ; bit number of reset bit
  89. bATADCRnIntEnable                EQU        1                    ; bit number of interrupt disable
  90. mATADCROne                        EQU        $08                    ; always one bit
  91. mATADCRReset                    EQU        $04                    ; Reset (1 = reset)
  92. mATADCRnIntEnable                EQU        $02                    ; Interrupt Disable(0 = enabled)
  93. ;  ATA Command Opcode definition
  94.  
  95. kATAcmdWORetry                    EQU        $01                    ; Without I/O retry option
  96. kATAcmdNOP                        EQU        $0000                ; NOP operation - media detect
  97. kATAcmdRecal                    EQU        $0010                ; Recalibrate command 
  98. kATAcmdRead                        EQU        $0020                ; Read command 
  99. kATAcmdReadLong                    EQU        $0022                ; Read Long command
  100. kATAcmdWrite                    EQU        $0030                ; Write command 
  101. kATAcmdWriteLong                EQU        $0032                ; Write Long
  102. kATAcmdWriteVerify                EQU        $003C                ; Write verify
  103. kATAcmdReadVerify                EQU        $0040                ; Read Verify command 
  104. kATAcmdFormatTrack                EQU        $0050                ; Format Track command 
  105. kATAcmdSeek                        EQU        $0070                ; Seek command 
  106. kATAcmdDiagnostic                EQU        $0090                ; Drive Diagnostic command 
  107. kATAcmdInitDrive                EQU        $0091                ; Init drive parameters command 
  108. kATAcmdReadMultiple                EQU        $00C4                ; Read multiple
  109. kATAcmdWriteMultiple            EQU        $00C5                ; Write multiple
  110. kATAcmdSetRWMultiple            EQU        $00C6                ; Set Multiple for Read/Write Multiple
  111. kATAcmdReadDMA                    EQU        $00C8                ; Read DMA (with retries)
  112. kATAcmdWriteDMA                    EQU        $00CA                ; Write DMA (with retries)
  113. kATAcmdMCAcknowledge            EQU        $00DB                ; Acknowledge media change - removable
  114. kATAcmdDoorLock                    EQU        $00DE                ; Door lock
  115. kATAcmdDoorUnlock                EQU        $00DF                ; Door unlock
  116. kATAcmdStandbyImmed                EQU        $00E0                ; Standby Immediate
  117. kATAcmdIdleImmed                EQU        $00E1                ; Idle Immediate
  118. kATAcmdStandby                    EQU        $00E2                ; Standby
  119. kATAcmdIdle                        EQU        $00E3                ; Idle
  120. kATAcmdReadBuffer                EQU        $00E4                ; Read sector buffer command 
  121. kATAcmdCheckPowerMode            EQU        $00E5                ; Check power mode command    <04/04/94>
  122. kATAcmdSleep                    EQU        $00E6                ; Sleep
  123. kATAcmdWriteBuffer                EQU        $00E8                ; Write sector buffer command 
  124. kATAcmdWriteSame                EQU        $00E9                ; Write same data to multiple sectors
  125. kATAcmdDriveIdentify            EQU        $00EC                ; Identify Drive command 
  126. kATAcmdMediaEject                EQU        $00ED                ; Media Eject
  127. kATAcmdSetFeatures                EQU        $00EF                ; Set Features
  128. ;  Set feature command opcodes
  129.  
  130. kATAEnableWriteCache            EQU        $02                    ;        Enable write cache
  131. kATASetTransferMode                EQU        $03                    ;        Set transfer mode
  132. kATASetPIOMode                    EQU        $08                    ;        PIO Flow Control Tx Mode bit
  133. kATAEnableECC                    EQU        $88                    ;        ECC enable
  134. kATAEnableRetry                    EQU        $99                    ;        Retry enable
  135. kATAEnableReadAhead                EQU        $AA                    ;        Read look-ahead enable
  136.  
  137. ;  --------------------------------------------------------------------------------
  138. ;   enums for dealing with device IDs
  139.  
  140.  
  141.  
  142.  
  143. kATABusIDMask                    EQU        $000000FF
  144. kATADeviceIDMask                EQU        $0000FF00
  145. kATADeviceIDClippingMask        EQU        $0000FFFF
  146. kMinBusID                        EQU        $00000000
  147. kMaxBusID                        EQU        $000000FE
  148.  
  149. kATAStartIterateDeviceID        EQU        $FFFF
  150. kATAEndIterateDeviceID            EQU        $FF
  151. ; --------------------------------------------------------------------------------
  152. ;  Device Register Images  (8 bytes) 
  153. ataTaskFile                RECORD 0
  154. ataTFFeatures             ds.b    1                ; offset: $0 (0)        ;  <-> Error(R) or ataTFFeatures(W) register image 
  155. ataTFCount                 ds.b    1                ; offset: $1 (1)        ;  <-> Sector count/remaining 
  156. ataTFSector                 ds.b    1                ; offset: $2 (2)        ;  <-> Sector start/finish 
  157. ataTFReserved             ds.b    1                ; offset: $3 (3)        ;  reserved                    
  158. ataTFCylinder             ds.w    1                ; offset: $4 (4)        ;  <-> ataTFCylinder (Big endian) 
  159. ataTFSDH                 ds.b    1                ; offset: $6 (6)        ;  <-> ataTFSDH register image
  160. ataTFCommand             ds.b    1                ; offset: $7 (7)        ;  <-> Status(R) or Command(W) register image 
  161. sizeof                     EQU *                    ; size:   $8 (8)
  162.                         ENDR
  163. ;  ATA Manager Function Code Definition
  164.  
  165. kATAMgrNOP                        EQU        $00                    ; No Operation
  166. kATAMgrExecIO                    EQU        $01                    ; Execute ATA I/O
  167. kATAMgrBusInquiry                EQU        $03                    ; Bus Inquiry
  168. kATAMgrQRelease                    EQU        $04                    ; I/O Queue Release
  169. kATAMgrAbort                    EQU        $10                    ; Abort command
  170. kATAMgrBusReset                    EQU        $11                    ; Reset ATA bus
  171. kATAMgrRegAccess                EQU        $12                    ; Register Access
  172. kATAMgrDriveIdentify            EQU        $13                    ; Drive Identify            <DP03/10/94>
  173. kATAMgrDriverLoad                EQU        $82                    ; Load driver from either Media, ROM, etc.
  174. kATAMgrDriveRegister            EQU        $85                    ; Register a driver        <4/18/94>
  175. kATAMgrFindDriverRefnum            EQU        $86                    ; lookup a driver refnum    <4/18/94>
  176. kATAMgrRemoveDriverRefnum        EQU        $87                    ; De-register a driver    <4/18/94>
  177. kATAMgrModifyEventMask            EQU        $88                    ; Modify driver event mask
  178. kATAMgrDriveEject                EQU        $89                    ; Eject the drive        <8/1/94>
  179. kATAMgrGetDrvConfiguration        EQU        $8A                    ; Get device configuration    <8/6/94>
  180. kATAMgrSetDrvConfiguration        EQU        $8B                    ; Set device configuration <8/6/94>
  181. kATAMgrGetLocationIcon            EQU        $8C                    ; Get card location icon    <SM4>
  182. kATAMgrManagerInquiry            EQU        $90                    ; Manager Inquiry
  183. kATAMgrManagerInit                EQU        $91                    ; Manager initialization
  184. kATAMgrManagerShutdown            EQU        $92                    ; Manager ShutDown
  185.                                                             ; note: functions 0x93 to 0x97 are reserved
  186. kATAMgrFindSpecialDriverRefnum    EQU        $98                    ; lookup a driver refnum; driverloader,notify-all or ROM driver.
  187. kATAMgrNextAvailable            EQU        $99
  188. ;  used in the ataDrvrFlags field for kATAMgrDriveRegister,kATAMgrRemoveDriverRefnum & kATAMgrFindSpecialDriverRefnum
  189.  
  190. kATANotifyAllDriver                EQU        0                    ; Notify-All driver
  191. kATADriverLoader                EQU        1                    ; Driver loader driver        
  192. kATAROMDriver                    EQU        2                    ; ROM driver
  193. ;  'ATAFlags' field of the PB header definition
  194.  
  195. bATAFlagUseConfigSpeed            EQU        15                    ; bit number of use default speed flag
  196. bATAFlagByteSwap                EQU        14                    ; bit number of byte swap flag
  197. bATAFlagIORead                    EQU        13                    ; bit number of I/O read flag
  198. bATAFlagIOWrite                    EQU        12                    ; bit number of I/O write flag
  199. bATAFlagImmediate                EQU        11                    ; bit number of immediate flag
  200. bATAFlagQLock                    EQU        10                    ; bit number of que lock on error
  201. bATAFlagReserved1                EQU        9                    ; reserved
  202. bATAFlagUseScatterGather        EQU        8                    ; bit numbers of scatter gather
  203. bATAFlagUseDMA                    EQU        7                    ; bit number of use DMA flag
  204. bATAFlagProtocolATAPI            EQU        5                    ; bit number of ATAPI protocol
  205. bATAFlagReserved2                EQU        4                    ; reserved
  206. bATAFlagTFRead                    EQU        3                    ; bit number of register update
  207. bATAFlagLEDEnable                EQU        0                    ; bit number of LED enable
  208. mATAFlagUseConfigSpeed            EQU        $8000
  209. mATAFlagByteSwap                EQU        $4000                ; Swap data bytes (read - after; write - before)
  210. mATAFlagIORead                    EQU        $2000                ; Read (in) operation
  211. mATAFlagIOWrite                    EQU        $1000                ; Write (out) operation
  212. mATAFlagImmediate                EQU        $0800                ; Head of Que; Immediate operation
  213. mATAFlagQLock                    EQU        $0400                ; Manager queue lock on error (freeze the queue)
  214. mATAFlagUseScatterGather        EQU        $0100                ; Scatter gather enable
  215. mATAFlagUseDMA                    EQU        $80
  216. mATAFlagProtocolATAPI            EQU        $20                    ; ATAPI protocol indicator
  217. mATAFlagTFRead                    EQU        $08                    ; update reg block request upon detection of an error
  218. mATAFlagLEDEnable                EQU        $01                    ; socket LED enable
  219. ;  These are legacy ATAFlags definitions, which will go away in the future
  220.  
  221. bATAFlagScatterGather1            EQU        9                    ; 9
  222. bATAFlagScatterGather0            EQU        8                    ; 8
  223. bATAFlagProtocol1                EQU        5                    ; 5
  224. bATAFlagProtocol0                EQU        4                    ; 4
  225. mATAFlagScatterGather1            EQU        $0200
  226. mATAFlagScatterGather0            EQU        $0100
  227. mATAFlagScatterGathers            EQU        $0300
  228. mATAFlagProtocol1                EQU        $20
  229. mATAFlagProtocol0                EQU        $10
  230. mATAFlagProtocols                EQU        $30
  231. ataPBHeader                RECORD 0
  232. ;  Start of cloned common header ataPBHdr 
  233. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  234. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  235. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number
  236. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  237. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  238. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  239. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  240. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  241. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  242. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  243. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  244. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  245. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  246. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  247. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  248. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  249. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  250. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  251. ;  End of cloned common header ataPBHdr
  252. sizeof                     EQU *                    ; size:   $30 (48)
  253.                         ENDR
  254. ;  data request entry structure (16 bytes)
  255. IOBlock                    RECORD 0
  256. ataPBBuffer                 ds.l    1                ; offset: $0 (0)        ;  -->: Data buffer pointer
  257. ataPBByteCount             ds.l    1                ; offset: $4 (4)        ;  -->: Data transfer length in bytes
  258. sizeof                     EQU *                    ; size:   $8 (8)
  259.                         ENDR
  260.  
  261. ;   For ATAPI devices the ExtendedPB field is a pointer to the Command Packet
  262. ;   record which exists of an array of words structured as follows…    <06/15/94>
  263.  
  264.  
  265. ATAPICmdPacket            RECORD 0
  266. atapiPacketSize             ds.w    1                ; offset: $0 (0)        ;  Size of command packet in bytes    <06/15/94>
  267. atapiCommandByte         ds.w    8                ; offset: $2 (2)        ;  The command packet itself    <06/15/94>
  268. sizeof                     EQU *                    ; size:   $12 (18)
  269.                         ENDR
  270. ;  Manager parameter block structure (96 bytes)
  271. ataIOPB                    RECORD 0
  272. ;  Start of cloned common header ataPBHdr
  273. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  274. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  275. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  276. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  277. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  278. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  279. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  280. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  281. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  282. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  283. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  284. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  285. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  286. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  287. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  288. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  289. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  290. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  291. ;  End of cloned common header ataPBHdr
  292. ataPBStatusRegister         ds.b    1                ; offset: $30 (48)        ;  <--: Last ATA status image
  293. ataPBErrorRegister         ds.b    1                ; offset: $31 (49)        ;  <--: Last ATA error image-valid if lsb of Status set
  294. ataPBReserved5             ds.w    1                ; offset: $32 (50)        ;  Reserved
  295. ataPBLogicalBlockSize     ds.l    1                ; offset: $34 (52)        ;  -->: Blind transfer size per interrupt (Logical block size)
  296. ataPBBuffer                 ds.l    1                ; offset: $38 (56)        ;  -->: Data buffer pointer
  297. ataPBByteCount             ds.l    1                ; offset: $3C (60)        ;  -->: Data transfer length in bytes
  298. ataPBActualTxCount         ds.l    1                ; offset: $40 (64)        ;  <--: Actual transfer count
  299. ataPBReserved6             ds.l    1                ; offset: $44 (68)        ;  Reserved
  300. ataPBTaskFile             ds        ataTaskFile        ; offset: $48 (72)        ;  <->:    Device register images
  301. ataPBPacketPtr             ds.l    1                ; offset: $50 (80)        ;  -->: ATAPI packet command block pointer (valid with ATAPI bit set)
  302. ataPBReserved7             ds.w    6                ; offset: $54 (84)        ;  Reserved for future expansion
  303. sizeof                     EQU *                    ; size:   $60 (96)
  304.                         ENDR
  305. ;  Parameter block structure for bus and Manager inquiry command
  306. ;  Manager parameter block structure
  307. ataBusInquiry            RECORD 0
  308. ;  Start of cloned common header ataPBHdr
  309. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  310. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  311. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  312. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  313. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  314. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  315. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  316. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  317. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  318. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  319. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  320. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  321. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  322. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  323. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  324. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  325. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  326. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  327. ;  End of cloned common header ataPBHdr
  328. ataEngineCount             ds.w    1                ; offset: $30 (48)        ;  <--: TBD; zero for now
  329. ataReserved1             ds.w    1                ; offset: $32 (50)        ;  Reserved
  330. ataDataTypes             ds.l    1                ; offset: $34 (52)        ;  <--: TBD; zero for now
  331. ataIOpbSize                 ds.w    1                ; offset: $38 (56)        ;  <--: Size of ATA IO PB
  332. ataMaxIOpbSize             ds.w    1                ; offset: $3A (58)        ;  <--: TBD; zero for now
  333. ataFeatureFlags             ds.l    1                ; offset: $3C (60)        ;  <--: TBD
  334. ataVersionNum             ds.b    1                ; offset: $40 (64)        ;  <--: Version number for the HBA
  335. ataHBAInquiry             ds.b    1                ; offset: $41 (65)        ;  <--: TBD; zero for now
  336. ataReserved2             ds.w    1                ; offset: $42 (66)        ;  Reserved
  337. ataHBAPrivPtr             ds.l    1                ; offset: $44 (68)        ;  <--: Ptr to HBA private data area
  338. ataHBAPrivSize             ds.l    1                ; offset: $48 (72)        ;  <--: Size of HBA private data area
  339. ataAsyncFlags             ds.l    1                ; offset: $4C (76)        ;  <--: Event capability for callback
  340. ataPIOModes                 ds.b    1                ; offset: $50 (80)        ;  <--: PIO modes supported (bit-significant)
  341. ataUltraDMAModes         ds.b    1                ; offset: $51 (81)        ;  <--: Ultra DMA modes supported (b-sig)
  342. ataSingleDMAModes         ds.b    1                ; offset: $52 (82)        ;  <--: Single Word DMA modes supported (b-sig)    
  343. ataMultiDMAModes         ds.b    1                ; offset: $53 (83)        ;  <--: Multiword DMA modes supported (b-sig)
  344. ataReserved4             ds.l    4                ; offset: $54 (84)        ;  Reserved
  345. ataReserved5             ds.b    16                ; offset: $64 (100)        ;  TBD
  346. ataHBAVendor             ds.b    16                ; offset: $74 (116)        ;  <--: Vendor ID of the HBA
  347. ataContrlFamily             ds.b    16                ; offset: $84 (132)        ;  <--: Family of ATA Controller
  348. ataContrlType             ds.b    16                ; offset: $94 (148)        ;  <--: Model number of controller
  349. ataXPTversion             ds.b    4                ; offset: $A4 (164)        ;  <--: version number of XPT
  350. ataReserved6             ds.b    4                ; offset: $A8 (168)        ;  Reserved
  351. ataHBAversion             ds        NumVersion        ; offset: $AC (172)        ;  <--: version number of HBA
  352. ataHBAslotType             ds.b    1                ; offset: $B0 (176)        ;  <--: type of slot
  353. ataHBAslotNum             ds.b    1                ; offset: $B1 (177)        ;  <--: slot number of the HBA
  354. ataReserved7             ds.w    1                ; offset: $B2 (178)        ;  Reserved
  355. ataReserved8             ds.l    1                ; offset: $B4 (180)        ;  Reserved
  356. sizeof                     EQU *                    ; size:   $B8 (184)
  357.                         ENDR
  358. ;  Manager parameter block structure
  359. ataMgrInquiry            RECORD 0
  360. ;  Start of cloned common header ataPBHdr
  361. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  362. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  363. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  364. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  365. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  366. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  367. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  368. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  369. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  370. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  371. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  372. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  373. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  374. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  375. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  376. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  377. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  378. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  379. ;  End of cloned common header ataPBHdr
  380. ataMgrVersion             ds        NumVersion        ; offset: $30 (48)        ;  Manager Version information
  381. ataMgrPBVers             ds.b    1                ; offset: $34 (52)        ;  <--: Manager PB version number supported
  382. Reserved1                 ds.b    1                ; offset: $35 (53)        ;  Reserved
  383. ataBusCnt                 ds.w    1                ; offset: $36 (54)        ;  <--: Number of ATA buses in the system
  384. ataDevCnt                 ds.w    1                ; offset: $38 (56)        ;  <--: Total number of ATA devices detected
  385. ataPioModes                 ds.b    1                ; offset: $3A (58)        ;  <--: Maximum Programmed I/O speed mode supported
  386. Reserved2                 ds.b    1                ; offset: $3B (59)        ;  Reserved
  387. ataIOClkResolution         ds.w    1                ; offset: $3C (60)        ;  <--: IO Clock resolution in nsec (Not supported)
  388. ataSingleDMAModes         ds.b    1                ; offset: $3E (62)        ;  <--: Single Word DMA modes supported    
  389. ataMultiDMAModes         ds.b    1                ; offset: $3F (63)        ;  <--: Multiword DMA modes supported
  390. Reserved                 ds.w    16                ; offset: $40 (64)        ;  Reserved for future expansion
  391. sizeof                     EQU *                    ; size:   $60 (96)
  392.                         ENDR
  393. ;  Parameter block structure for Abort command
  394. ;  Manager parameter block structure
  395. ataAbort                RECORD 0
  396. ;  Start of cloned common header ataPBHdr
  397. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  398. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  399. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  400. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  401. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  402. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  403. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  404. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  405. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  406. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  407. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  408. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  409. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  410. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  411. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  412. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  413. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  414. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  415. ;  End of cloned common header ataPBHdr
  416. ataAbortPB                 ds.l    1                ; offset: $30 (48)        ;  -->: Parameter block to be aborted
  417. Reserved                 ds.w    22                ; offset: $34 (52)        ;  Reserved for future expansion
  418. sizeof                     EQU *                    ; size:   $60 (96)
  419.                         ENDR
  420. ;  Manager parameter block structure
  421. ATAEventRec                RECORD 0
  422. ataEventCode             ds.w    1                ; offset: $0 (0)        ;  --> ATA event code
  423. ataPhysicalID             ds.w    1                ; offset: $2 (2)        ;  --> Physical drive reference
  424. ataDrvrContext             ds.l    1                ; offset: $4 (4)        ;  Context pointer saved by driver
  425. ataMarker                 ds.l    1                ; offset: $8 (8)        ;  Always 'LOAD'
  426. ataEventRecVersion         ds.l    1                ; offset: $C (12)        ;  Version number of this data structure
  427. ataDeviceType             ds.l    1                ; offset: $10 (16)        ;  Device type on bus (valid for load driver only)
  428. ataRefNum                 ds.w    1                ; offset: $14 (20)        ;  RefNum of driver (valid for remove driver only)
  429. sizeof                     EQU *                    ; size:   $16 (22)
  430.                         ENDR
  431. ; typedef struct ATAEventRec *            ATAEventRecPtr
  432.  
  433. ;  Parameter block structure for Driver Register command
  434. ;  Manager parameter block structure
  435. ataDrvrRegister            RECORD 0
  436. ;  Start of cloned common header ataPBHdr
  437. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  438. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  439. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  440. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  441. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  442. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  443. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  444. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  445. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  446. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  447. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  448. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  449. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  450. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  451. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  452. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  453. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  454. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  455. ;  End of cloned common header ataPBHdr
  456. ataDrvrRefNum             ds.w    1                ; offset: $30 (48)        ;  <->: Driver reference number
  457. ataDrvrFlags             ds.w    1                ; offset: $32 (50)        ;  -->: 1 = loader driver if ataPBDeviceID = -1 {PB2}
  458. ataDeviceNextID             ds.w    1                ; offset: $34 (52)        ;  <--: used to specified the next drive ID
  459. ataDrvrLoadPriv             ds.w    1                ; offset: $36 (54)        ;  Driver loader private storage
  460. ataEventHandler             ds.l    1                ; offset: $38 (56)        ;  <->: Pointer to ATA event callback routine {PB2}
  461. ataDrvrContext             ds.l    1                ; offset: $3C (60)        ;  <->: Context data saved by driver {PB2}
  462. ataEventMask             ds.l    1                ; offset: $40 (64)        ;  <->: Set to 1 for notification of event {PB2}
  463. Reserved                 ds.w    14                ; offset: $44 (68)        ;  Reserved for future expansion - from [21] {PB2}
  464. sizeof                     EQU *                    ; size:   $60 (96)
  465.                         ENDR
  466. ;  Parameter block structure for Modify driver event mask command
  467. ataModifyEventMask        RECORD 0
  468. ;  Start of cloned common header ataPBHdr
  469. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  470. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  471. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  472. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  473. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  474. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  475. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  476. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  477. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  478. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  479. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  480. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  481. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  482. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  483. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  484. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  485. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  486. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  487. ;  End of cloned common header ataPBHdr
  488. ataModifiedEventMask     ds.l    1                ; offset: $30 (48)        ;  -->: new event mask value
  489. Reserved                 ds.w    22                ; offset: $34 (52)        ;  Reserved for future expansion
  490. sizeof                     EQU *                    ; size:   $60 (96)
  491.                         ENDR
  492. ;  'ataRegMask' field of the ataRegAccess definition
  493.  
  494. bATAAltSDevCValid                EQU        14                    ; bit number of alternate status/device cntrl valid bit
  495. bATAStatusCmdValid                EQU        7                    ; bit number of status/command valid bit
  496. bATASDHValid                    EQU        6                    ; bit number of ataTFSDH valid bit
  497. bATACylinderHiValid                EQU        5                    ; bit number of cylinder high valid bit
  498. bATACylinderLoValid                EQU        4                    ; bit number of cylinder low valid bit
  499. bATASectorNumValid                EQU        3                    ; bit number of sector number valid bit
  500. bATASectorCntValid                EQU        2                    ; bit number of sector count valid bit
  501. bATAErrFeaturesValid            EQU        1                    ; bit number of error/features valid bit
  502. bATADataValid                    EQU        0                    ; bit number of data valid bit
  503. mATAAltSDevCValid                EQU        $4000                ; alternate status/device control valid
  504. mATAStatusCmdValid                EQU        $80                    ; status/command valid
  505. mATASDHValid                    EQU        $40                    ; ataTFSDH valid
  506. mATACylinderHiValid                EQU        $20                    ; cylinder high valid
  507. mATACylinderLoValid                EQU        $10                    ; cylinder low valid
  508. mATASectorNumValid                EQU        $08                    ; sector number valid
  509. mATASectorCntValid                EQU        $04                    ; sector count valid
  510. mATAErrFeaturesValid            EQU        $02                    ; error/features valid
  511. mATADataValid                    EQU        $01                    ; data valid
  512. ;  Parameter block structure for device register access command
  513. ataRegValueUnion        RECORD 0
  514. ataByteRegValue             ds.b    1                ; offset: $0 (0)        ;  <->: Byte register value read or to be written
  515.                          ORG 0
  516. ataWordRegValue             ds.w    1                ; offset: $0 (0)        ;  <->: Word register value read or to be written
  517. sizeof                     EQU *                    ; size:   $2 (2)
  518.                         ENDR
  519. ;  Manager parameter block structure
  520. ataRegAccess            RECORD 0
  521. ;  Start of cloned common header ataPBHdr
  522. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  523. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  524. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  525. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  526. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  527. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  528. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  529. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  530. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  531. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  532. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  533. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  534. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  535. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  536. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  537. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  538. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  539. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  540. ;  End of cloned common header ataPBHdr
  541. ataRegSelect             ds.w    1                ; offset: $30 (48)        ;  -->: Device Register Selector
  542. ;             DataReg            0    
  543. ;             ErrorReg(R) or FeaturesReg(W)    1
  544. ;             SecCntReg        2
  545. ;             SecNumReg        3
  546. ;             CylLoReg        4
  547. ;             CylHiReg        5
  548. ;             SDHReg            6
  549. ;             StatusReg(R) or CmdReg(W)        7
  550. ;             AltStatus(R) or DevCntr(W)    0E
  551. ataRegValue                 ds        ataRegValueUnion ; offset: $32 (50)
  552. ;  Following fields are valid only if ataRegSelect = 0xFFFF
  553. ataRegMask                 ds.w    1                ; offset: $34 (52)        ;  -->: mask for register(s) to update
  554. ;         bit 0 : data register valid
  555. ;         bit 1 : error/feaures register valid
  556. ;         bit 2 : sector count register valid
  557. ;         bit 3 : sector number register valid
  558. ;         bit 4 : cylinder low register valid
  559. ;         bit 5 : cylinder high register valid
  560. ;         bit 6 : ataTFSDH register valid
  561. ;         bit 7 : status/command register valid
  562. ;         bits 8 - 13 : reserved (set to 0)
  563. ;         bit 14: alternate status / device control reg valid
  564. ;          bit 15: reserved (set to 0)
  565. ataRegisterImage         ds        ataTaskFile        ; offset: $36 (54)        ;  <->: register images
  566. ataAltSDevCReg             ds.b    1                ; offset: $3E (62)        ;  <->: Alternate status(R) or Device Control(W) register image
  567. Reserved3                 ds.b    1                ; offset: $3F (63)        ;  Reserved
  568. Reserved                 ds.w    16                ; offset: $40 (64)        ;  Reserved for future expansion
  569. sizeof                     EQU *                    ; size:   $60 (96)
  570.                         ENDR
  571. ;  Manager parameter block structure    <DP03/10/94>
  572. ataIdentify                RECORD 0
  573. ;  Start of cloned common header ataPBHdr
  574. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  575. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  576. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  577. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  578. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  579. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  580. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  581. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  582. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  583. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  584. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  585. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  586. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  587. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  588. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  589. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  590. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  591. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  592. ;  End of cloned common header ataPBHdr
  593. Reserved1                 ds.w    4                ; offset: $30 (48)        ;  Reserved.  These are used internally by the Manager
  594. ataPBBuffer                 ds.l    1                ; offset: $38 (56)        ;  Buffer for the identify data (512 bytes)
  595. Reserved2                 ds.w    12                ; offset: $3C (60)        ;  Used internally by the ATA Manager
  596. Reserved3                 ds.w    6                ; offset: $54 (84)        ;  Reserved for future expansion
  597. sizeof                     EQU *                    ; size:   $60 (96)
  598.                         ENDR
  599. ;  'ataConfigSetting' field of the Get/Set Device Configuration definition <8/6/94>
  600.  
  601. ATAPIpacketDRQ_bit                EQU        6                    ; bit number of ATAPI command packet DRQ option
  602. ATAPIpacketDRQ                    EQU        $40                    ; ATAPI command packet DRQ option
  603. ;  atapcValid field definition
  604.  
  605. bATApcAccessMode                EQU        0
  606. bATApcVcc                        EQU        1
  607. bATApcVpp1                        EQU        2
  608. bATApcVpp2                        EQU        3
  609. bATApcStatus                    EQU        4
  610. bATApcPin                        EQU        5
  611. bATApcCopy                        EQU        6
  612. bATApcConfigIndex                EQU        7
  613. bATApcLockUnlock                EQU        15
  614. mATApcAccessMode                EQU        $01
  615. mATApcVcc                        EQU        $02
  616. mATApcVpp1                        EQU        $04
  617. mATApcVpp2                        EQU        $08
  618. mATApcStatus                    EQU        $10
  619. mATApcPin                        EQU        $20
  620. mATApcCopy                        EQU        $40
  621. mATApcConfigIndex                EQU        $80
  622. mATApcLockUnlock                EQU        $8000
  623. ;  Device physical type & socket type indicator definition
  624.  
  625. kATADeviceUnknown                EQU        $00                    ; no device or type undetermined
  626. kATADeviceATA                    EQU        $01                    ; traditional ATA protocol device <7/29/94>
  627. kATADeviceATAPI                    EQU        $02                    ; ATAPI protocol device    <7/29/94>
  628. kATADeviceReserved                EQU        $03                    ; reserved by Apple (was PCMCIA)
  629.  
  630. kATASocketInternal                EQU        $01                    ; Internal ATA socket
  631. kATASocketMB                    EQU        $02                    ; Media Bay socket
  632. kATASocketPCMCIA                EQU        $03                    ; PCMCIA socket
  633. ;  reserved words at the end of the devConfig structure
  634.  
  635. kATAConfigReserved                EQU        5                    ; number of reserved words at the end
  636.  
  637. ;   Get/Set Device Configuration parameter block structure <8/6/94>
  638. ;   Manager parameter block structure
  639.  
  640.  
  641. ataDevConfiguration        RECORD 0
  642. ;  Start of cloned common header ataPBHdr
  643. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  644. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  645. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  646. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  647. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  648. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  649. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  650. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  651. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  652. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  653. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  654. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  655. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  656. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  657. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  658. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  659. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  660. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  661. ;  End of cloned common header ataPBHdr
  662. ataConfigSetting         ds.l    1                ; offset: $30 (48)        ;  <->: Configuration setting
  663. ;       Bits 3 - 0: Reserved
  664. ;       Bit 4: Reserved (allowLBAAccess)
  665. ;       Bit 5: Reserved (allowRWMultiple)
  666. ;       Bit 6: ATAPIpacketDRQ
  667. ;         1 = Check for Interrupt DRQ on ATAPI command packet DRQ
  668. ;         0 = Default: Check only for the assertion of command packet DRQ
  669. ;       Bits 31 - 7: Reserved
  670. ataPIOSpeedMode             ds.b    1                ; offset: $34 (52)        ;  <->: Device access speed in PIO Mode
  671. Reserved3                 ds.b    1                ; offset: $35 (53)        ;  Reserved to force word alignment
  672. atapcValid                 ds.w    1                ; offset: $36 (54)        ;  <->: Set when pcXXX fields are valid (atapcAccessMode - atapcConfigIndex)
  673. ;         bit 0 - atapcAccessMode field valid, when set
  674. ;         bit 1 - atapcVcc field valid, when set
  675. ;         bit 2 - atapcVpp1 field valid, when set
  676. ;         bit 3 - atapcVpp2 field valid, when set
  677. ;         bit 4 - atapcStatus field valid, when set
  678. ;         bit 5 - atapcPin field valid, when set
  679. ;         bit 6 - atapcCopy field valid, when set
  680. ;         bit 7 - atapcConfigIndex field valid, when set
  681. ;         bits 14-8 - Reserved
  682. ;         bit 15 - device lock/unlock request (write only)
  683. ataRWMultipleCount         ds.w    1                ; offset: $38 (56)        ;  Reserved for future (not supported yet)
  684. ataSectorsPerCylinder     ds.w    1                ; offset: $3A (58)        ;  Reserved for future (not supported yet)
  685. ataHeads                 ds.w    1                ; offset: $3C (60)        ;  Reserved for future (not supported yet)
  686. ataSectorsPerTrack         ds.w    1                ; offset: $3E (62)        ;  Reserved for future (not supported yet)
  687. ataSocketNumber             ds.w    1                ; offset: $40 (64)        ;  <--: Socket number used by the CardServices
  688. ;         0xFF = socket number invalid (Not a CardServices device)
  689. ;         other = socket number of the device
  690. ataSocketType             ds.b    1                ; offset: $42 (66)        ;  <--: Specifies the socket type (get config only)
  691. ;         00 = Unknown socket
  692. ;          01 = Internal ATA bus
  693. ;         02 = Media Bay
  694. ;         03 = PCMCIA
  695. ataDeviceType             ds.b    1                ; offset: $43 (67)        ;  <--: Specifies the device type (get config only)
  696. ;         00 = Unknown device
  697. ;         01 = standard ATA device (HD)
  698. ;         02 = ATAPI device
  699. ;         03 = PCMCIA ATA device
  700. atapcAccessMode             ds.b    1                ; offset: $44 (68)        ;  <->: Access mode: Memory vs. I/O (PCMCIA only)
  701. atapcVcc                 ds.b    1                ; offset: $45 (69)        ;  <->: Voltage in tenths of a volt (PCMCIA only)
  702. atapcVpp1                 ds.b    1                ; offset: $46 (70)        ;  <->: Voltage in tenths of a volt (PCMCIA only)
  703. atapcVpp2                 ds.b    1                ; offset: $47 (71)        ;  <->: Voltage in tenths of a volt (PCMCIA only)
  704. atapcStatus                 ds.b    1                ; offset: $48 (72)        ;  <->: Card Status register setting (PCMCIA only)
  705. atapcPin                 ds.b    1                ; offset: $49 (73)        ;  <->: Card Pin register setting (PCMCIA only)
  706. atapcCopy                 ds.b    1                ; offset: $4A (74)        ;  <->: Card Socket/Copy register setting (PCMCIA only)
  707. atapcConfigIndex         ds.b    1                ; offset: $4B (75)        ;  <->: Card Option register setting (PCMCIA only)
  708. ataSingleDMASpeed         ds.b    1                ; offset: $4C (76)        ;  <->: Single Word DMA Timing Class
  709. ataMultiDMASpeed         ds.b    1                ; offset: $4D (77)        ;  <->: Multiple Word DMA Timing Class
  710. ataPIOCycleTime             ds.w    1                ; offset: $4E (78)        ;  <->:Cycle time for PIO mode
  711. ataMultiCycleTime         ds.w    1                ; offset: $50 (80)        ;  <->:Cycle time for Multiword DMA mode
  712. ataUltraDMASpeed         ds.b    1                ; offset: $52 (82)        ;  <-> Ultra DMA timing class
  713. reserved2                 ds.b    1                ; offset: $53 (83)        ;  reserved
  714. ataUltraCycleTime         ds.w    1                ; offset: $54 (84)        ;  <-> Cycle time for Ultra DMA mode
  715. Reserved1                 ds.w    5                ; offset: $56 (86)        ;  Reserved for future
  716. sizeof                     EQU *                    ; size:   $60 (96)
  717.                         ENDR
  718. ;  Get Card Location Icon/Text    <SM4>
  719.  
  720. kATALargeIconHFS                EQU        $0001                ; Large B&W icon with mask (HFS)
  721. kATALargeIconProDOS                EQU        $0081                ; Large B&W icon with mask (ProDOS)
  722. ;  Manager parameter block structure
  723. ataLocationData            RECORD 0
  724. ;  Start of cloned common header ataPBHdr
  725. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  726. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  727. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  728. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  729. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  730. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  731. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  732. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  733. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  734. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  735. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  736. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  737. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  738. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  739. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  740. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  741. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  742. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  743. ;  End of cloned common header ataPBHdr
  744. ataIconType                 ds.w    1                ; offset: $30 (48)        ;  -->: icon type specifier
  745. ;          1 = Large B&W icon with mask (256 bytes)
  746. ;         0x81 = Same as 1, but ProDOS icon
  747. ataIconReserved             ds.w    1                ; offset: $32 (50)        ;  Reserved to be longword aligned
  748. ataLocationIconPtr         ds.l    1                ; offset: $34 (52)        ;  -->: Icon Data buffer pointer
  749. ataLocationStringPtr     ds.l    1                ; offset: $38 (56)        ;  -->: Icon String buffer pointer
  750. Reserved1                 ds.w    18                ; offset: $3C (60)        ;  Reserved for future
  751. sizeof                     EQU *                    ; size:   $60 (96)
  752.                         ENDR
  753. ;  ataOSType available
  754.  
  755. kATAddTypeMacOS                    EQU        $0001                ; Blue Mac O/S ddType value
  756. ;  The parameter block definition for all other ATA Manager functions.
  757.  
  758. ataGeneric                RECORD 0
  759. ;  Start of cloned common header ataPBHdr
  760. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  761. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  762. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  763. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  764. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  765. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  766. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  767. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  768. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  769. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  770. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  771. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  772. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  773. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  774. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  775. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  776. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  777. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  778. ;  End of cloned common header ataPBHdr
  779. Reserved                 ds.w    24                ; offset: $30 (48)        ;  Reserved for future
  780. sizeof                     EQU *                    ; size:   $60 (96)
  781.                         ENDR
  782. ataPB                    RECORD 0
  783. ataIOParamBlock             ds        ataIOPB            ; offset: $0 (0)        ;  parameter block for I/O
  784.                          ORG 0
  785. ataBIParamBlock             ds        ataBusInquiry    ; offset: $0 (0)        ;  parameter block for bus inquiry
  786.                          ORG 0
  787. ataMIParamBlock             ds        ataMgrInquiry    ; offset: $0 (0)        ;  parameter block for Manager inquiry
  788.                          ORG 0
  789. ataAbortParamBlock         ds        ataAbort        ; offset: $0 (0)        ;  parameter block for abort
  790.                          ORG 0
  791. ataDRParamBlock             ds        ataDrvrRegister ; offset: $0 (0)        ;  parameter block for driver register
  792.                          ORG 0
  793. ataMEParamBlock             ds        ataModifyEventMask ; offset: $0 (0)        ;  parameter block for event mask modify
  794.                          ORG 0
  795. ataRAParamBlock             ds        ataRegAccess    ; offset: $0 (0)        ;  parameter block for register access
  796.                          ORG 0
  797. ataDIParamBlock             ds        ataIdentify        ; offset: $0 (0)        ;  parameter block for drive identify
  798.                          ORG 0
  799. ataDCParamBlock             ds        ataDevConfiguration ; offset: $0 (0)    ;  parameter block for device configuration
  800.                          ORG 0
  801. ataLDParamBlock             ds        ataLocationData ; offset: $0 (0)        ;  parameter block for location icon data
  802. ; ataManagerInit    ataInitParamBlock;        // parameter block for Manager initialization
  803. ; ataManagerShutDn    ataSDParamBlock;        // parameter block for Manager shutdown
  804. ; ataDrvrLoad        ataDLParamBlock;        // parameter block for Driver loading
  805.                          ORG 0
  806. ataGenericParamBlock     ds        ataGeneric        ; offset: $0 (0)        ;  parameter block for all other functions
  807.                          ORG 184
  808. sizeof                     EQU *                    ; size:   $B8 (184)
  809.                         ENDR
  810. ;  The ATA Event codes…
  811.  
  812. kATANullEvent                    EQU        $00                    ; Just kidding -- nothing happened
  813. kATAOnlineEvent                    EQU        $01                    ; An ATA device has come online
  814. kATAOfflineEvent                EQU        $02                    ; An ATA device has gone offline
  815. kATARemovedEvent                EQU        $03                    ; An ATA device has been removed from the bus
  816. kATAResetEvent                    EQU        $04                    ; Someone gave a hard reset to the drive
  817. kATAOfflineRequest                EQU        $05                    ; Someone requesting to offline the drive
  818. kATAEjectRequest                EQU        $06                    ; Someone requesting to eject the drive
  819. kATAUpdateEvent                    EQU        $07                    ; Potential configuration change reported by CardServices <SM4>
  820. kATATaskTimeRequest                EQU        $08                    ; The manager is requesting to be called at Task Time
  821. kATALoadDriverNow                EQU        $09                    ; Load the driver for the given bus immediately
  822. kATAPIResetEvent                EQU        $0A                    ; Someone gave a ATAPI reset to the drive
  823.                                                             ; The following describes bit definitions in the eventMask field of ataDrvrRegister
  824. bATANullEvent                    EQU        $01                    ; null event bit
  825. bATAOnlineEvent                    EQU        $02                    ; online event bit
  826. bATAOfflineEvent                EQU        $04                    ; offline event bit
  827. bATARemovedEvent                EQU        $08                    ; removed event bit
  828. bATAResetEvent                    EQU        $10                    ; ATA reset event bit
  829. bATAOfflineRequest                EQU        $20                    ; offline request event bit
  830. bATAEjectRequest                EQU        $40                    ; eject request event bit
  831. bATAUpdateEvent                    EQU        $80                    ; configuration update event bit
  832. bATAPIResetEvent                EQU        $0400                ; ATAPI reset event bit
  833.  
  834. kATAEventMarker                    EQU        'LOAD'                ; Marker for the event data structure
  835. kATAEventVersion1                EQU        $00000001            ; Version 1 of the event structure
  836. ;
  837. ; pascal SInt16 ataManager(ataPB *pb)
  838. ;
  839.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  840.         _ataManager:    OPWORD    $AAF1
  841.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  842.         IMPORT_CFM_FUNCTION ataManager
  843.     ENDIF
  844.  
  845. ;  Device Error codes: 0xDB42 - 0xDB5F    
  846.  
  847.  
  848. ATABaseErrCode                    EQU        -9406                ; Base error code - 0xDB42    
  849. ioPending                        EQU        1                    ; Asynch I/O in progress status
  850. AT_NRdyErr                        EQU        -9405                ; 0xDB43: Drive not Ready 
  851. AT_IDNFErr                        EQU        -9404                ; 0xDB44: ID not found 
  852. AT_DMarkErr                        EQU        -9403                ; 0xDB45: Data mark not found 
  853. AT_BadBlkErr                    EQU        -9402                ; 0xDB46: Bad Block 
  854. AT_CorDataErr                    EQU        -9401                ; 0xDB47: Data was corrected 
  855. AT_UncDataErr                    EQU        -9400                ; 0xDB48: Data was not corrected 
  856. AT_SeekErr                        EQU        -9399                ; 0xDB49: Seek error 
  857. AT_WrFltErr                        EQU        -9398                ; 0xDB4A: Write fault 
  858. AT_RecalErr                        EQU        -9397                ; 0xDB4B: Recalibrate failed 
  859. AT_AbortErr                        EQU        -9396                ; 0xDB4C: Command aborted by drive 
  860. AT_MCErr                        EQU        -9394                ; 0xDB4E: Media Changed error
  861. ATAPICheckErr                    EQU        -9393                ; 0xDB4F: ATAPI Check condition <06/15/94>
  862.                                                             ; System error codes...Custom Driver Error Codes 0xDB60 - 0xDB6F
  863. DRVRCantAllocate                EQU        -9376                ; 0xDB60: Allocation error during initialization
  864. NoATAMgr                        EQU        -9375                ; 0xDB61: MgrInquiry failed => No ATA Manager
  865. ATAInitFail                        EQU        -9374                ; 0xDB62: Mgr Initialization failed
  866. ATABufFail                        EQU        -9373                ; 0xDB63: Device buffer test failure
  867. ATADevUnsupported                EQU        -9372                ; 0xDB64: Device type not supported
  868. ATAEjectDrvErr                    EQU        -9371                ; 0xDB65: Could not eject the drive
  869.                                                             ; Manager Error Codes 0xDB70 - 0xDB8F
  870. ATAMgrNotInitialized            EQU        -9360                ; 0xDB70: Mgr has not been initialized
  871. ATAPBInvalid                    EQU        -9359                ; 0xDB71: The bus base address couldn't be found
  872. ATAFuncNotSupported                EQU        -9358                ; 0xDB72: An unknown function code specified
  873. ATABusy                            EQU        -9357                ; 0xDB73: Selected device is busy
  874. ATATransTimeOut                    EQU        -9356                ; 0xDB74: Transaction timeout detected
  875. ATAReqInProg                    EQU        -9355                ; 0xDB75: Channel busy; channel is processing another cmd
  876. ATAUnknownState                    EQU        -9354                ; 0xDB76: Device status register reflects an unknown state
  877. ATAQLocked                        EQU        -9353                ; 0xDB77: I/O Queue is locked due to previous I/O error.
  878. ATAReqAborted                    EQU        -9352                ; 0xDB78: The I/O queue entry was aborted due to an abort req.
  879.                                                             ;            or due to Manager shutdown.
  880. ATAUnableToAbort                EQU        -9351                ; 0xDB79: The I/O queue entry could not be aborted.
  881. ATAAbortedDueToRst                EQU        -9350                ; 0xDB7A: Request aborted due to a device reset command.
  882. ATAPIPhaseErr                    EQU        -9349                ; 0xDB7B: Unexpected phase - •••IS THIS VALID ERROR??? <06/15/94>
  883. ATAPITxCntErr                    EQU        -9348                ; 0xDB7C: Overrun/Underrun condition detected
  884. ATANoClientErr                    EQU        -9347                ; 0xDB7D: No client present to handle the event
  885. ATAInternalErr                    EQU        -9346                ; 0xDB7E: MagnumOpus returned an error
  886. ATABusErr                        EQU        -9345                ; 0xDB7F: Bus error detected on I/O    
  887. AT_NoAddrErr                    EQU        -9344                ; 0xDB80: Invalid AT base adress 
  888. DriverLocked                    EQU        -9343                ; 0xDB81: Current driver must be removed before adding another
  889. CantHandleEvent                    EQU        -9342                ; 0xDB82: Particular event couldn't be handled (call others)
  890. ATAMgrMemoryErr                    EQU        -9341                ; 0xDB83: Manager memory allocation error    
  891. ATASDFailErr                    EQU        -9340                ; 0xDB84: Shutdown failure                
  892. ATAXferParamErr                    EQU        -9339                ; 0xDB85: I/O xfer parameters inconsistent 
  893. ATAXferModeErr                    EQU        -9338                ; 0xDB86: I/O xfer mode not supported 
  894. ATAMgrConsistencyErr            EQU        -9337                ; 0XDB87: Manager detected internal inconsistency. 
  895. ATADmaXferErr                    EQU        -9336                ; 0XDB88: fatal error in DMA side of transfer 
  896.                                                             ; Driver loader error Codes 0xDB90 - 0xDBA5
  897. ATAInvalidDrvNum                EQU        -9328                ; 0xDB90: Invalid drive number from event
  898. ATAMemoryErr                    EQU        -9327                ; 0xDB91: Memory allocation error
  899. ATANoDDMErr                        EQU        -9326                ; 0xDB92: No DDM found on media    
  900. ATANoDriverErr                    EQU        -9325                ; 0xDB93: No driver found on the media    
  901. ;  ------------------------    Version 1 definition -------------------------------    
  902.  
  903. v1ATABaseErrCode                EQU        $0700                ; This needs a home somewhere
  904. v1AT_NRdyErr                    EQU        $FFFFF901            ; 0xF901: -0x1DBE 
  905. v1AT_IDNFErr                    EQU        $FFFFF904            ; 0xF904: -0x1DC0 
  906. v1AT_DMarkErr                    EQU        $FFFFF905            ; 0xF905: -0x1DC0 
  907. v1AT_BadBlkErr                    EQU        $FFFFF906            ; 0xF906: -0x1DC0 
  908. v1AT_CorDataErr                    EQU        $FFFFF907            ; 0xF907: -0x1DC0 
  909. v1AT_UncDataErr                    EQU        $FFFFF908            ; 0xF908: -0x1DC0 
  910. v1AT_SeekErr                    EQU        $FFFFF909            ; 0xF909: -0x1DC0 
  911. v1AT_WrFltErr                    EQU        $FFFFF90A            ; 0xF90A: -0x1DC0 
  912. v1AT_RecalErr                    EQU        $FFFFF90B            ; 0xF90B: -0x1DC0 
  913. v1AT_AbortErr                    EQU        $FFFFF90C            ; 0xF90C: -0x1DC0 
  914. v1AT_NoAddrErr                    EQU        $FFFFF90D            ; 0xF90D: -0x1D8D 
  915. v1AT_MCErr                        EQU        $FFFFF90E            ; 0xF90E: -0x1DC0
  916.                                                             ; System error codes...Custom Driver Error Codes
  917. v1DRVRCantAllocate                EQU        -1793                ; 0xF8FF: -0x1D9F
  918. v1NoATAMgr                        EQU        -1794                ; 0xF8FE: -0x1D9D
  919. v1ATAInitFail                    EQU        -1795                ; 0xF8FD: -0x1D9B
  920. v1ATABufFail                    EQU        -1796                ; 0xF8FC: -0x1D99
  921. v1ATADevUnsupported                EQU        -1797                ; 0xF8FB: -0x1c97
  922.                                                             ; Manager Error Codes
  923. v1ATAMgrNotInitialized            EQU        -1802                ; 0xF8F6: -0x1D86
  924. v1ATAPBInvalid                    EQU        -1803                ; 0xF8F5: -0x1D84
  925. v1ATAFuncNotSupported            EQU        -1804                ; 0xF8F4: -0x1D82
  926. v1ATABusy                        EQU        -1805                ; 0xF8F3: -0x1D80
  927. v1ATATransTimeOut                EQU        -1806                ; 0xF8F2: -0x1D7E
  928. v1ATAReqInProg                    EQU        -1807                ; 0xF8F1: -0x1D7C
  929. v1ATAUnknownState                EQU        -1808                ; 0xF8F0: -0x1D7A
  930. v1ATAQLocked                    EQU        -1809                ; 0xF8EF: -0x1D78
  931. v1ATAReqAborted                    EQU        -1810                ; 0xF8EE: -0x1D76
  932. v1ATAUnableToAbort                EQU        -1811                ; 0xF8ED: -0x1D74
  933. v1ATAAbortedDueToRst            EQU        -1812                ; 0xF8EC: -0x1D72
  934.  
  935.     ENDIF ; __ATA__ 
  936.  
  937.